// pages/other/web.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    url: 'https://m.feijiu.net/zhuanti/live2020/',
    urlPath:'',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let that = this
    // this.setData({
    //   url: 'http://10.10.9.173:5500?longUID=0&iswx=1',
    //   urlPath: 'http://10.10.9.173:5500?longUID=0&iswx=1'
    // })
    // return
    if (!options) {
      this.setData({
        url: options.url,
        urlPath: options.url
      })
    } else {
      const eventChannel = this.getOpenerEventChannel()
      // 监听 acceptDataFromOpenerPage 事件，获取上一页面通过 eventChannel 传送到当前页面的数据
      eventChannel.on('acceptDataFromOpenerPage', function (eventData) {
        // var webUrl= eventData.url+'&longUID='+logUid;
        var FjLoginLog = wx.getStorageSync('FjLoginLog');
        var urls= eventData.url+(eventData.url.includes("?")?(FjLoginLog.UID?'&longUID='+FjLoginLog.UID+'&&iswx=1':"&longUID=0&iswx=1"):"?longUID=0&iswx=1")
        // if(FjLoginLog.UID){
        //   urls = eventData.url+'?longUID='+FjLoginLog.UID
        // }
        that.setData({
          url:urls,
          urlPath: eventData.url
        }) 
        wx.setStorageSync('zhuantiurl',eventData.url);
      })
    }

   
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
      let that = this
      var FjLoginLog = wx.getStorageSync('FjLoginLog');
      var urls= that.data.urlPath+'?longUID=0'
      if(FjLoginLog.UID){
        urls = that.data.urlPath+'?longUID='+FjLoginLog.UID
      }
      that.setData({
        url:urls
      }) 
     
  },
 
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    wx.setStorageSync('zhuantiurl','');
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})